Function |saturating_to_u8

std/conv::|saturating_to_u8


Usage

|saturating_to_u8<T>(value)

Generics

◻ T: SaturatingToU8

Parameters

↳ value: T

Return

↴ u8


Turns data into u8, saturating if needed.

This function makes a saturating and infaillible conversion to u8. If incoming data represents something out of bounds for u8, then the resulting value is set to minimum or maximum, depending what is the closest to truth.